/*
 *  Texture.h
 *  MD2 File Loading
 *
 *  Created by Seth Willits on 9/11/04.
 *  Copyright 2004 Freak Software. All rights reserved.
 *  
 *  Portions of this file are from the MD2 file loading routines
 *  found in Chapter 18 of OpenGL Game Programming by Kevin Hawkins
 *  and Dave Astle. 
 */

#ifndef __TEXTURE__
#define __TEXTURE__

#include <stdio.h>
#include <iostream>
#include <GL/glut.h>


enum MD2TextureTypes
{
	PCX
};


typedef struct 
{
	// C Compatible version: enum texTypes textureType;
	// We use C++ only version
	MD2TextureTypes textureType;

	int width;					// width of texture
	int height;					// height of texture
	long int scaledWidth;
	long int scaledHeight;

	unsigned int texID;			// the texture object id of this texture
	unsigned char *data;		// the texture data
	unsigned char *palette;
} MD2Texture;


// only partial pcx file header
typedef struct
{
	unsigned char manufacturer;
	unsigned char version;
	unsigned char encoding;
	unsigned char bits;
	unsigned char xMin;
	unsigned char yMin;
	unsigned char xMax;
	unsigned char yMax;
	unsigned char *palette;
} PCXHEADER;

MD2Texture *LoadTexture(char *filename);



#endif